package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.enums.RoomOrderStatusEnum;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

import java.util.Date;

/**
 * 客房订单对象 room_order
 * 
 * @author 强盛酒店
 * @date 2023-03-09
 */
public class RoomOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 客房订单id */
    private Long id;

    /** 预订人姓名 */
    @Excel(name = "预订人姓名")
    private String userName;

    /** 身份证号码 */
    @Excel(name = "身份证号码")
    private String idCard;

    /** 联系方式 */
    @Excel(name = "联系方式")
    private String phone;

    /** 入住时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "入住时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date liveTime;

    /** 离店时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "离店时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date leaveTime;

    /** 居住天数 */
    @Excel(name = "居住天数")
    private Integer dwellingDay;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private Integer status;

    /** 房间id */
    @Excel(name = "房间id")
    private Long roomId;

    /** 订单价格 */
    @Excel(name = "订单价格")
    private String orderPrice;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long createUser;

    /** 修改人 */
    @Excel(name = "修改人")
    private Long updateUser;

    /** 是否已删除 */
    @Excel(name = "是否已删除")
    private Integer isDeleted;

    @Transient
    private String roomName;

    @Transient
    private String statusName;

    @Transient
    private Room room;

    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getStatusName() throws Exception {
        if (status!=null){
            statusName = RoomOrderStatusEnum.getEnum(status).getName();
        }
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }
    public void setIdCard(String idCard) 
    {
        this.idCard = idCard;
    }

    public String getIdCard() 
    {
        return idCard;
    }
    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }
    public void setLiveTime(Date liveTime) 
    {
        this.liveTime = liveTime;
    }

    public Date getLiveTime() 
    {
        return liveTime;
    }
    public void setLeaveTime(Date leaveTime) 
    {
        this.leaveTime = leaveTime;
    }

    public Date getLeaveTime() 
    {
        return leaveTime;
    }
    public void setDwellingDay(Integer dwellingDay) 
    {
        this.dwellingDay = dwellingDay;
    }

    public Integer getDwellingDay() 
    {
        return dwellingDay;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }
    public void setRoomId(Long roomId) 
    {
        this.roomId = roomId;
    }

    public Long getRoomId() 
    {
        return roomId;
    }
    public void setOrderPrice(String orderPrice) 
    {
        this.orderPrice = orderPrice;
    }

    public String getOrderPrice() 
    {
        return orderPrice;
    }
    public void setCreateUser(Long createUser) 
    {
        this.createUser = createUser;
    }

    public Long getCreateUser() 
    {
        return createUser;
    }
    public void setUpdateUser(Long updateUser) 
    {
        this.updateUser = updateUser;
    }

    public Long getUpdateUser() 
    {
        return updateUser;
    }
    public void setIsDeleted(Integer isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() 
    {
        return isDeleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userName", getUserName())
            .append("idCard", getIdCard())
            .append("phone", getPhone())
            .append("liveTime", getLiveTime())
            .append("leaveTime", getLeaveTime())
            .append("dwellingDay", getDwellingDay())
            .append("status", getStatus())
            .append("roomId", getRoomId())
            .append("orderPrice", getOrderPrice())
            .append("createTime", getCreateTime())
            .append("createUser", getCreateUser())
            .append("updateTime", getUpdateTime())
            .append("updateUser", getUpdateUser())
            .append("isDeleted", getIsDeleted())
            .toString();
    }
}
